<template>
	<view class="caseList">
		<view class="caseItem" @click="navigator(item.id)" v-for="item in goods" :key="item.id">
			<image :src="item.img" mode="widthFix"></image>
			<view class="info">
				<text class=" u-line-2">{{item.name}}</text>
				<view class="price">
					<text class="unit">￥</text>
					{{item.price}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		props:['goods'],
		methods:{
			navigator(id){
				this.$emit('goodsItemClick',id)
			}
		}
	}
</script>

<style lang="scss">
	.caseList{
		padding:0 10rpx;
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		.caseItem{
			display:flex;
			flex-direction: column;
			
			width: 50%;
			padding:8rpx;
			box-sizing: border-box;
			image{
				width:100%;
				display: block;
				margin: auto;
				border-top-right-radius: 8rpx;
				border-top-left-radius: 8rpx;
			}
			.info{
				display: flex;
				flex-direction: column;
				background-color: #fff;
				padding: 16rpx;
				border-bottom-left-radius: 12rpx;
				border-bottom-right-radius: 12rpx;
				font-size: 26rpx;
			}
			.unit{
				font-size: 22rpx;
			}
			.price{
				color: #f00;
				padding:  10rpx 0;
				font-size: 32rpx;
			}
		}
	}
</style>